/**
 * @file
 *
 * Used on the full calendar views page only (month, week, day, agenda, etc.).
 */

// ======================
// = Variables & mixins =
// ======================
// Based on Bootstrap. Modify variables.less for custom colors, font-sizes, etc.
@import "variables.less";
@import "mixins.less";
@import "mixins-custom.less";

// =================
// = Calendar page =
// =================

// General calendar page container.
.ai1ec-container {
  clear: both;
}

// Calendar view container.
#ai1ec-calendar-view-container {
  position: relative;
  clear: both;
  margin-bottom: 0.2em;
}
.ai1ec-calendar-toolbar {
  width: 100% !important;
  border: 0 !important;
  margin: 0 !important;
  td {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    width: 33%;
  }
  td:last-child {
    text-align: right;
  }
  td:first-child {
    text-align: left;
  }
}

// View dropdown button.
.thenly #ai1ec-view-dropdown {
  a.btn,
  .dropdown-menu a {
    line-height: 21px;
  }
  a.btn .caret {
    margin-top: 9px;
  }
  a img {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    position: static !important;
    vertical-align: bottom;
    background: none !important;
  }
}

// View filters.
.ai1ec-filters-container {
  display: inline-block;
}
.ai1ec-filter-selector-container {
  position: relative;
  display: inline-block;
  text-align: left;
  white-space: normal;
}
.ai1ec-filter-selector {
  display: none;
  background: @dropdownBackground;
  border: 1px solid @dropdownBorder;
  .border-radius(5px);
  .box-shadow(0 5px 10px rgba(0,0,0,.2));
  padding: 0.1em;
  position: absolute;
  overflow: auto;
  max-width: 20em;
  max-height: 30em;
  right: 0;
  top: 100%;
  z-index: 10;
  ul {
    margin: 0 !important;
    padding: 0 !important;
  }
  li {
    list-style: none;
  }
  .ai1ec-category,
  .ai1ec-tag {
    font-size: 8pt !important;
  }
}
.ai1ec-filter-selector-container:hover > .ai1ec-filter-selector {
  display: block;
}
.ai1ec-clear-filters {
  display: none;
  font-size: 11pt !important;
  font-weight: normal;
  color: @linkColor !important;
  cursor: pointer;
  text-decoration: none !important;
  &:hover {
    color: @linkColorHover !important;
  }
}

// Titles.
h2.ai1ec-calendar-title {
  float: left;
  font-size: 20px !important;
  line-height: 1.3em !important;
  margin: 0 0.5em 0 0 !important;
}

// Today button hidden on today's date.
.ai1ec-today #ai1ec-today {
  display: none;
}

// View pagination buttons.
.ai1ec-action-month .ai1ec-pagination a {
  width: 7em;
}
.ai1ec-action-week .ai1ec-pagination a,
.ai1ec-action-oneday .ai1ec-pagination a {
  width: 8em;
}
.ai1ec-action-agenda .ai1ec-pagination a {
  width: 9em;
}
#ai1ec-prev-year, #ai1ec-next-year {
  width: 4em;
}

// Month, week, day tables.
table.ai1ec-month-view,
.ai1ec-week-view table,
.ai1ec-oneday-view table {
  border-collapse: collapse;
  border: 1px solid @tableBorder !important;
  margin: 0 !important;
  background: @tableBackground;
  table-layout: fixed !important;
  clear: both;
  width: 100% !important;
}
.ai1ec-week-view .tablescroll_wrapper,
.ai1ec-oneday-view .tablescroll_wrapper {
  position: relative;
  border-bottom: 1px solid @tableBorder;
}
table.ai1ec-week-view-original,
table.ai1ec-oneday-view-original {
  visibility: hidden;
  height: 400px;
  &.tablescroll_body {
    visibility: visible;
    height: auto;
  }
}
.ai1ec-week-view,
.ai1ec-oneday-view {
  table.tablescroll_head,
  table.tablescroll_head th {
    border-bottom: none !important;
    padding: 2.48px !important;
  }
}
table.ai1ec-week-view-original,
table.ai1ec-oneday-view-original {
  &.tablescroll_body,
  &.tablescroll_body tr:first-child td {
    border-top: none !important;
  }
}
.ai1ec-month-view,
.ai1ec-week-view,
.ai1ec-oneday-view {
  td {
    border: 1px solid @tableBorder !important;
    background: none !important;
    padding: 0 !important;
    text-align: left;
    vertical-align: top;
  }
  th {
    border: none !important;
    background: @tableLabelBackground !important;
    padding: 0.2em !important;
  }
}
.ai1ec-month-view td.ai1ec-empty {
  background: @tableLabelBackground !important;
}
.ai1ec-month-view th,
.ai1ec-week-view th,
.ai1ec-week-view .ai1ec-hour-marker div,
.ai1ec-week-view .ai1ec-allday-label,
.ai1ec-oneday-view th,
.ai1ec-oneday-view .ai1ec-hour-marker div,
.ai1ec-oneday-view .ai1ec-allday-label {
  color: @tableLabelText !important;
  text-shadow: 0 1px 0 @textEmboss;
}
.ai1ec-month-view,
.ai1ec-oneday-view {
  th {
    text-align: center !important;
  }
}
.ai1ec-week-view th {
  text-align: left !important;
}
.ai1ec-week-view,
.ai1ec-oneday-view {
  .ai1ec-day {
    height: 1440px;
  }
  th .ai1ec-weekday-date {
    font-size: 10.5pt !important;
    font-weight: normal !important;
  }
}
.ai1ec-week-view th .ai1ec-weekday-day {
  font-size: 9pt !important;
  font-weight: normal !important;
}
.ai1ec-month-view .ai1ec-day,
.ai1ec-week-view .ai1ec-day,
.ai1ec-week-view .ai1ec-allday-events,
.ai1ec-oneday-view .ai1ec-day,
.ai1ec-oneday-view .ai1ec-allday-events {
  position: relative;
}
.ai1ec-month-view .ai1ec-day-stretcher {
  float: left;
  height: 94px;
  width: 0;
}
.ai1ec-month-view,
.ai1ec-week-view {
  .ai1ec-today {
    background: @todayColor !important;
  }
}
.ai1ec-month-view .ai1ec-date {
  background: @monthViewDateBackground;
  color: mix(@textColor, @monthViewDateBackground, 40%);
  font-size: 10pt;
  line-height: 13px;
  height: 13px;
  margin-bottom: 1px;
  padding: 0 0.4em;
  font-size: 8pt;
  text-align: right;
  text-shadow: 0 1px 0 @textEmboss;
}

// Week/day view time/"now" markers.
.ai1ec-week-view,
.ai1ec-oneday-view {
  .ai1ec-grid-container {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
  }
  .ai1ec-now-marker,
  .ai1ec-hour-marker,
  .ai1ec-quarter-marker {
    position: absolute;
    left: 0;
    right: 0;
    padding-right: 8px;
  }
  .ai1ec-hour-marker {
    border-top: 1px solid @tableBorder;
    border-top: 1px solid fade(@tableBorder, 70%);
    height: 60px;
    background: fade(@tableBorder, 40%) !important;
    &.ai1ec-business-hour {
      background: none !important;
    }
  }
  .ai1ec-hour-marker div,
  .ai1ec-allday-label {
    position: relative;
    z-index: 2;
    margin-left: 1px;
    padding: 0 0.2em;
    font-size: 8pt !important;
    font-weight: normal !important;
    background: @tableLabelBackground;
    float: left;
    .border-radius(0.3em);
  }
  .ai1ec-allday-label {
    margin-top: 1px;
  }
  .ai1ec-quarter-marker {
    border-top: 1px solid @tableBorder;
    border-top: 1px solid fade(@tableBorder, 40%);
  }
  .ai1ec-now-marker {
    border-top: 1px solid @dayViewNowMarkerColor;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    z-index: 2;
  }
}

// Event summaries in month/week/day view, including popups.
.ai1ec-month-view,
.ai1ec-week-view,
.ai1ec-oneday-view {
  a.ai1ec-event-container {
    border: none !important;
    color: @linkColor !important;
    display: block;
    font-size: 9pt;
    text-decoration: none !important;
  }
  .ai1ec-event {
    .border-radius(0.3em);
    margin: 1px 0 0;
    max-height: 100%;
    overflow: hidden;
    padding: 0 3px 1px;
    white-space: nowrap;
  }
  .ai1ec-allday .ai1ec-event,
  .ai1ec-multiday .ai1ec-event {
    background-color: @linkColor;
    color: @eventStubAllDayText !important;
  }
  .ai1ec-category-colors {
    float: right;
    font-size: 1.2em;
    margin-top: 1px;
  }
  .ai1ec-event-popup,
  .ai1ec-event-summary {
    border: 2px solid @eventBorder;
    .box-shadow(0 5px 10px rgba(0,0,0,.2));
    background: @eventBackground;
  }
  .ai1ec-event-popup {
    position: absolute;
    z-index: 5;
    display: none;
    white-space: nowrap;
    color: @eventText !important;
    top: -5px;
    left: -2px;
    min-width: 100%;
    .border-radius(0 0.3em 0.3em 0);
    &.ai1ec-shifted-right {
      .border-radius(0.3em 0 0 0.3em);
    }
  }
  .ai1ec-event-popup-bg {
    position: relative;
    left: -2px;
    margin-right: -1px;
    padding: 2px 2px 2px 5px;
    background: @eventBackground;
  }
  .ai1ec-shifted-right .ai1ec-event-popup-bg {
    left: 1px;
    padding: 2px 5px 2px 2px;
  }
  .ai1ec-event-summary,
  .ai1ec-event-summary p {
    font-size: 0.95em !important;
  }
  .ai1ec-event-summary {
    .border-radius(0.3em 0 0.3em 0.3em);
    color: @eventText;
    #gradient > .vertical-three-colors(@eventBackground, @eventBackground, 1.5em, @eventBackgroundBottom); // !important needed, but not working here with lessc HEAD as of 2012-04-25
    overflow: hidden;
    padding: 2px 4px 3px;
    position: absolute;
    right: 100%;
    top: -2px;
    white-space: normal;
    width: 13em;
  }
  .ai1ec-shifted-right .ai1ec-event-summary {
    left: 100%;
    .border-radius(0 0.3em 0.3em 0.3em);
  }
  .ai1ec-event-summary p {
    margin: 0 0 0.3em !important;
    padding: 0 !important;
  }
  .ai1ec-event-time {
    font-size: 8pt;
    font-weight: bold;
  }
  .ai1ec-read-more {
    text-align: center;
    font-size: 8pt;
    color: mix(@eventText, @eventBackgroundBottom, 50%);
  }
}
.ai1ec-month-view,
.ai1ec-week-view .ai1ec-allday-events,
.ai1ec-oneday-view .ai1ec-allday-events {
  a.ai1ec-event-container {
    position: relative;
  }
}
.ai1ec-oneday-view {
  a.ai1ec-event-container {
    margin-right: 10px;
  }
}
.ai1ec-oneday-view .ai1ec-allday-events a.ai1ec-event-container {
  margin: 0 15px 0 50px;
}
.ai1ec-week-view .ai1ec-week,
.ai1ec-oneday-view .ai1ec-oneday {
  a.ai1ec-event-container {
    border: 2px solid mix(@eventDefaultColor, @eventBackground, 30%) !important;
    .border-radius(0.3em);
    .box-shadow(0 3px 6px rgba(0,0,0,0.2));
    .box-sizing(border-box);
    #gradient > .vertical(@eventBackground, mix(@eventDefaultColor, @eventBackground, 30%));
    background-color: @eventBackground;
    position: absolute;
    right: 0;
  }
}
.ai1ec-oneday-view .ai1ec-event-popup {
  top: -3px;
  min-width: 0;
  right: 13em;
}
.ai1ec-week-view .ai1ec-week .ai1ec-event-popup {
  top: -3px;
}
.ai1ec-oneday-view .ai1ec-oneday,
.ai1ec-week-view .ai1ec-week {
  .ai1ec-event-title {
    display: block;
    white-space: normal;
    font-size: 8pt !important;
  }
}

// Month view multi-day bars and dropdowns.
.ai1ec-month-view {
  .ai1ec-event {
    height: 14px;
    line-height: 14px;
    margin: 0 0 1px;
  }
  .ai1ec-multiday {
    position: absolute;
  }
  .ai1ec-multiday-arrow1 {
    background: @eventDefaultColor;
    border: 7px solid @bodyBackground;
    border-left-color: @eventDefaultColor;
    border-right-width: 0;
    height: 1px;
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
  }
  .ai1ec-multiday-arrow2 {
    border: 7px solid @eventDefaultColor;
    border-left-color: @bodyBackground;
    border-right-width: 2px;
    height: 1px;
    left: 0;
    position: absolute;
    top: 0;
    width: 0;
  }
  .ai1ec-multiday-bar {
    background: @eventDefaultColor;
    .border-radius(3px);
    height: 15px;
    left: 0;
    position: absolute;
    top: 0;
    .ai1ec-event-title {
      margin-left: 7px;
    }
    .ai1ec-event {
      margin: 0;
    }
    .ai1ec-event-time {
      display: none;
    }
  }
  .ai1ec-event-dropdown {
    background: #FFF;
    border: 1px solid #E7E7E7;
    border-top: 0;
    left: -1px;
    position: absolute;
    top: 78px;
    width: 90px;
    z-index: 1000;
  }
  .ai1ec-obscured {
    display: none !important;
  }
  a.ai1ec-scroll-up,
  a.ai1ec-scroll-down {
    border: 1px solid @tableBorder;
    .border-radius(0.2em);
    .box-sizing(border-box);
    display: block;
    left: 50%;
    height: 16px;
    line-height: 14px;
    margin-left: -8px;
    position: relative;
    text-align: center;
    text-decoration: none !important;
    width: 16px;
    &:hover {
      background-color: @tableBorder;
    }
    &.ai1ec-disabled {
      border: none;
      cursor: default;
      .opacity(20);
      padding: 1px; // To compensate for height lost by invisible border.
      &:hover {
        background-color: transparent;
      }
    }
  }
  .ai1ec-event-popup .ai1ec-event-popup-allround {
    border-radius: 0.3em;
    .ai1ec-event-popup-bg {
      left: 0;
      margin-right: 2px;
      padding: 2px;
    }
    .ai1ec-event-summary {
      display: none;
    }
  }
}

// Truncated events.
.ai1ec-oneday-view,
.ai1ec-week-view {
  .ai1ec-start-truncated .ai1ec-event-time {
    display: none;
  }
}
.ai1ec-oneday-view .ai1ec-oneday,
.ai1ec-week-view .ai1ec-week {
  a.ai1ec-event-container {
    &.ai1ec-start-truncated {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
      -moz-border-radius-topleft: 0;
      -moz-border-radius-topright: 0;
      -webkit-border-top-left-radius: 0;
      -webkit-border-top-right-radius: 0;
    }
    &.ai1ec-end-truncated {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
      -moz-border-radius-bottomleft: 0;
      -moz-border-radius-bottomright: 0;
      -webkit-border-bottom-left-radius: 0;
      -webkit-border-bottom-right-radius: 0;
    }
  }
  .ai1ec-start-truncator,
  .ai1ec-end-truncator {
    position: absolute;
    line-height: 1em;
    font-size: 6pt;
  }
  .ai1ec-start-truncator {
    top: -2px;
    left: -2px;
  }
  .ai1ec-end-truncator {
    bottom: -2px;
    right: -2px;
  }
}

// Agenda view.
.ai1ec-agenda-view {
  clear: both;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  .ai1ec-no-results {
    font-size: 10pt !important;
    font-style: italic;
  }
  .ai1ec-date-events {
    overflow: hidden;
    margin: 0 0.75em 0 0 !important;
    padding: 0 !important;
  }
  > li,
  .ai1ec-date-events > li {
    list-style: none !important;
  }
  .ai1ec-date {
    border-top: 1px solid darken(@agendaDateBackground, 5%);
    #gradient > .vertical-three-colors-replace(@agendaDateBackground, @agendaDateBackground, 1em, fade(@agendaDateBackground, 0%)); // !important needed, but not working here with lessc HEAD as of 2012-04-25
    margin: 0 !important;
    overflow: hidden;
    padding: 0 !important;
  }
  .ai1ec-date.ai1ec-today {
    border-top: 1px solid darken(@agendaTodayBackground, 5%);
    #gradient > .vertical-three-colors-replace(@agendaTodayBackground, @agendaTodayBackground, 1em, fade(@agendaTodayBackground, 0%)); // !important needed, but not working here with lessc HEAD as of 2012-04-25
  }
  h3.ai1ec-date-title {
    border: 2px solid @agendaDateTitleBorder;
    .border-radius(0 0 5px 5px);
    .box-shadow(0 2px 2px rgba(0,0,0,0.08));
    color: mix(@textColor, @agendaDateTitleBackground, 85%);
    float: left;
    font-size: 10pt;
    font-weight: normal;
    #gradient > .vertical-three-colors(@agendaDateTitleBackground, @agendaDateTitleBackground, 1em, darken(@agendaDateTitleBackground, 12%));
    line-height: 1.1em;
    margin: 0 0.75em 0.5em !important;
    text-align: center;
    text-shadow: 0 1px 0 @textEmboss;
    width: 4em;
  }
  .ai1ec-month {
    color: @agendaDateTitleMonthText;
    background: @agendaDateTitleBorder;
    font-size: 0.8em !important;
    letter-spacing: 0.2em;
    padding: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
  }
  .ai1ec-day {
    font-size: 2.2em !important;
    padding: 0.3em 0 0.2em !important;
  }
  .ai1ec-weekday {
    font-size: 0.8em !important;
    line-height: 1.5em;
  }

  // Agenda view events.
  .ai1ec-event {
    position: relative;
    clear: right;
    overflow: hidden;
    font-size: 10pt;
    text-decoration: none;
    padding: 0.1em 0.3em !important;
    margin: 0.5em 0 !important;
    background: @eventBackground !important;
    border: 1px solid @eventBorder;
    .border-radius(0.5em);
    &.ai1ec-expanded {
      border: 2px solid @eventBorder;
      .box-shadow(1px 5px 8px rgba(0,0,0,0.08));
    }
    .ai1ec-event-click {
      cursor: pointer;
      line-height: 1.4em;
      color: @eventDefaultColor;
      text-shadow: 0 1px 0 @textEmboss;
      &:hover > .ai1ec-event-expand {
        visibility: visible;
      }
    }
    .ai1ec-event-time {
      float: left;
      margin-right: 0.5em;
      min-height: 1em;
      font-weight: bold;
      line-height: 1.4em;
    }
    .ai1ec-event-title {
      margin: 0 0 0 8em;
      font-size: 10pt;
      font-weight: normal;
    }
    &:hover,
    &.ai1ec-expanded:hover {
      border-color: @eventBorderHover;
    }
    &:hover .ai1ec-event-click {
      color: @eventDefaultColorHover;
    }
    &.ai1ec-allday {
      padding: 0 !important;
      .ai1ec-event-click {
        color: @eventStubAllDayText;
        background: @eventDefaultColor;
        padding: 0.1em 0.4em;
        .border-radius(0.3em);
        text-shadow: none;
      }
      .ai1ec-event-time {
        color: @eventStubAllDayText;
      }
      .ai1ec-event-title {
        margin: 0;
      }
      &:hover .ai1ec-event-click {
        color: @eventStubAllDayText;
        background: @eventDefaultColorHover;
      }
    }
  }
  .ai1ec-allday-label {
    font-size: 8pt;
    color: fade(@eventStubAllDayText, 50%);
    padding-left: 0.2em;
  }
  .ai1ec-event-expand {
    float: right;
    margin-left: 0.5em;
    visibility: hidden;
    font-size: 9pt;
  }
  .ai1ec-category-colors {
    float: left;
    font-size: 0.9em;
    margin: 0.2em 0.2em -0.2em -0.1em;
    .ai1ec-category-color {
      padding: 1px;
    }
  }

  // Agenda view expanded events.
  .ai1ec-event-summary {
    display: none;
    .ai1ec-event-title {
      margin: 0.1em 0;
      font-size: 11pt;
      line-height: 1.1em;
    }
    .ai1ec-event-time {
      width: auto;
      float: none;
      font-size: 9pt;
      line-height: 1.5em;
    }
    .ai1ec-event-click {
      border-bottom: 1px solid @tableBorder;
      margin-bottom: 0.4em;
      padding: 0.5em 0.25em;
    }
  }
  .ai1ec-allday .ai1ec-event-summary .ai1ec-event-click {
    border-bottom: none;
    .border-radius(0.3em 0.3em 0 0);
    padding: 0.4em 0.6em;
  }
  .ai1ec-categories,
  .ai1ec-tags {
    font-size: 8pt;
  }
  .ai1ec-event-description,
  .ai1ec-event-description p {
    font-size: 9pt;
    line-height: 1.5em;
  }
  .ai1ec-event-description {
    clear: both;
    overflow: hidden;
    padding: 0 0.25em 3.6em;
    max-height: 20em;
    p {
      margin: 0.5em 0 0.75em !important;
      padding: 0 !important;
    }
    .ai1ec-label {
      font-size: 8pt;
    }
  }
  .ai1ec-allday .ai1ec-event-description {
    position: relative;
    overflow: hidden;
    padding: 0 0.65em 3.5em;
  }

  // Agenda event overlay/read more.
  .ai1ec-event-overlay {
    position: absolute;
    z-index: 5;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4em 0.5em;
    .border-radius(0 0 0.5em 0.5em);
    #gradient > .vertical-replace(fade(@eventBackground, 75%), @eventBackgroundBottom);
  }
  .ai1ec-read-more {
    float: right;
    margin: 0.6em 0 0.2em;
  }
}

// Subscribe.
.ai1ec-subscribe {
  clear: both;
}
.ai1ec-subscribe-filtered {
  display: none;
}
// print icon
i.icon-print {
  padding: 0 7px;
}
